package com.longxi.tianjintianbao.ui.activity.quality;

import android.content.Intent;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;

import com.longxi.tianjintianbao.R;
import com.longxi.tianjintianbao.ui.base.BaseActivity;
import com.longxi.tianjintianbao.ui.presenter.quality.QualityStateChangesAtPresenter;
import com.longxi.tianjintianbao.ui.view.quality.IQualityStateChangesAtView;

import butterknife.BindView;

public class QualityStateChangesActivity extends BaseActivity<IQualityStateChangesAtView, QualityStateChangesAtPresenter> implements IQualityStateChangesAtView {

    @BindView(R.id.tvPerson)
    TextView mTvPerson;
    @BindView(R.id.tvLastdate)
    TextView mTvLastdate;
    @BindView(R.id.etFinishremark)
    EditText mEtFinishremark;
    @BindView(R.id.btnLogin)
    Button mBtnLogin;

    @Override
    protected int provideContentViewId() {
        return R.layout.activity_quality_state_changes;
    }

    @Override
    public void initData() {
        super.initData();
        mPresenter.setBar();

    }

    @Override
    public void initListener() {
        super.initListener();
        mTvPerson.setOnClickListener(v -> mPresenter.getDepartment(false));
        mTvLastdate.setOnClickListener(v -> mPresenter.getCurrentDateTime(mTvLastdate, true));
        mBtnLogin.setOnClickListener(v -> mPresenter.goFinshOrChange());
    }

    @Override
    protected QualityStateChangesAtPresenter createPresenter() {
        return new QualityStateChangesAtPresenter(this);
    }

    @Override
    public TextView getTvPerson() {
        return mTvPerson;
    }

    @Override
    public TextView getTvLastdate() {
        return mTvLastdate;
    }

    @Override
    public EditText getEtFinishremark() {
        return mEtFinishremark;
    }

    @Override
    public Button getBtnLogin() {
        return mBtnLogin;
    }

    @Override
    protected void onActivityResult(int requestCode, int resultCode, Intent data) {
        super.onActivityResult(requestCode, resultCode, data);
        mPresenter.onActivityResult(requestCode, resultCode, data);
    }

}


